import App from './App'
import EN from 'utils/language/EN.js'
import ZH from 'utils/language/ZH.js'
// import './common/mock/list.js'
const messages = {
	EN: EN,
	ZH: ZH
}

let i18nConfig = {
  locale: uni.getStorageSync('language_key') || 'ZH',// 获取已设置的语言
  messages
}
// #ifndef VUE3
import Vue from 'vue'
import VueI18n from 'vue-i18n'// v8.x
import './uni.promisify.adaptor'
Vue.use(VueI18n)
const i18n = new VueI18n(i18nConfig)

Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	i18n,
	...App
})
app.$mount()
// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	const i18n = new VueI18n(i18nConfig)
	app.use(i18n)
	return {
		app
	}
}
// #endif